_e_n_a_b_l_e expects either ....TTTTRRRRUUUUEEEE.... or ....FFFFAAAALLLLSSSSEEEE...., enabling or disabling
stencil operation. When stencil operation is disabled (the
default), the values of the subsequent six parameters are
ignored,
_r_e_f expects a reference value used by the stencil compare function.
_f_u_n_c expects one of eight flags specifying the stencil comparison
function. These flags are SSSSFFFFNNNNEEEEVVVVEEEE, SSSSFFFFLLLLEEEESSSSSSSS, SSSSFFFFEEEEQQQQUUUUAAAA, SSSSFFFFLLLLEEEEQQQQUUUU,
SSSSFFFFGGGGRRRREEEEAAAA, SSSSFFFFNNNNOOOOTTTTEEEE, SSSSFFFFGGGGEEEEQQQQUUUU, and SSSSFFFFAAAALLLLWWWWAAAA.
_m_a_s_k expects a mask specifying which stencil bitplanes are
significant during the comparison operation.
_f_a_i_l expects one of six flags indicating which stencil operation
should be performed should the stencil test fail. The values
are SSSSTTTTKKKKEEEEEEEEPPPP, SSSSTTTTZZZZEEEERRRROOOO, SSSSTTTTRRRREEEEPPPPLLLL, SSSSTTTTIIIINNNNCCCCRRRR, SSSSTTTTDDDDEEEECCCCRRRR, and SSSSTTTTIIIINNNNVVVVEEEE.
_p_a_s_s expects one of six flags indicating which stencil operation
should be performed should the stencil test pass, and the z-
buffer test (if z-buffering is enabled) fail. The values are
SSSSTTTTKKKKEEEEEEEEPPPP, SSSSTTTTZZZZEEEERRRROOOO, SSSSTTTTRRRREEEEPPPPLLLL, SSSSTTTTIIIINNNNCCCCRRRR, SSSSTTTTDDDDEEEECCCCRRRR, and SSSSTTTTIIIINNNNVVVVEEEE.
_z_p_a_s_s expects one of six flags indicating which stencil operation
should be performed should the stencil and z-buffer tests pass.
Its value is not significant when the z-buffer is not enabled.
The values are SSSSTTTTKKKKEEEEEEEEPPPP, SSSSTTTTZZZZEEEERRRROOOO, SSSSTTTTRRRREEEEPPPPLLLL, SSSSTTTTIIIINNNNCCCCRRRR, SSSSTTTTDDDDEEEECCCCRRRR, and
SSSSTTTTIIIINNNNVVVVEEEE.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
sssstttteeeennnncccciiii operates as a superior z-buffer test with a different algorithm.
When sssstttteeeennnncccciiii is enabled, each pixel write first tests the stencil
bitplanes. Both the color and z-buffer bitplane writes, as well as the
write of the stencil bitplanes, are conditioned by the stencil test.
sssstttteeeennnncccciiii operation can be enabled only if stencil bitplanes are present
(see sssstttteeeennnnssssiiii). Stencil bitplanes are present only in the normal
framebuffer, so sssstttteeeennnncccciiii should be called only while draw mode is NNNNOOOORRRRMMMMAAAALLLL.
When the z-buffer is enabled, three test cases are distinguished: